package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TradeType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Trade_Type", schema = "dbo", catalog = "StudentManager")
public class TradeType implements java.io.Serializable {

	// Fields

	private Long tradeTypeId;
	private String tradeTypeName;
	private Set<GraduateWorkUnit> graduateWorkUnits = new HashSet<GraduateWorkUnit>(
			0);

	// Constructors

	/** default constructor */
	public TradeType() {
	}

	/** minimal constructor */
	public TradeType(Long tradeTypeId, String tradeTypeName) {
		this.tradeTypeId = tradeTypeId;
		this.tradeTypeName = tradeTypeName;
	}

	/** full constructor */
	public TradeType(Long tradeTypeId, String tradeTypeName,
			Set<GraduateWorkUnit> graduateWorkUnits) {
		this.tradeTypeId = tradeTypeId;
		this.tradeTypeName = tradeTypeName;
		this.graduateWorkUnits = graduateWorkUnits;
	}

	// Property accessors
	@Id
	@Column(name = "Trade_Type_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getTradeTypeId() {
		return this.tradeTypeId;
	}

	public void setTradeTypeId(Long tradeTypeId) {
		this.tradeTypeId = tradeTypeId;
	}

	@Column(name = "Trade_Type_Name", nullable = false, length = 128)
	public String getTradeTypeName() {
		return this.tradeTypeName;
	}

	public void setTradeTypeName(String tradeTypeName) {
		this.tradeTypeName = tradeTypeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tradeType")
	public Set<GraduateWorkUnit> getGraduateWorkUnits() {
		return this.graduateWorkUnits;
	}

	public void setGraduateWorkUnits(Set<GraduateWorkUnit> graduateWorkUnits) {
		this.graduateWorkUnits = graduateWorkUnits;
	}

}